package com.zker.missyou.sample.core.configuration;/*
 * ClassName: ExceptionCodeConfiguration
 * Package : com.zker.missyou.sample.core.configuration
 * Description:
 * @Author zKer
 * @Create 2024/6/27 19:44
 */

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@ConfigurationProperties(prefix = "zker")
@PropertySource("classpath:config/exception-code.properties")
@Data
@Component
public class ExceptionCodeConfiguration {
    private Map<Integer,String> codes = new HashMap<>();
    public String getMessage(int code){
        return codes.get(code);
    }

}
